package com.zjcode.cdcer.service.impl;

import com.chinatechstar.component.commons.utils.RecursiveListUtils;
import com.zjcode.cdcer.mapper.TkmEndoscopeDiagnoseNounInfoMapper;
import com.zjcode.cdcer.model.TkmEndoscopeDiagnoseNounInfo;
import com.zjcode.cdcer.service.TkmEndoscopeDiagnoseNounInfoService;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName:TkmEndoscopeDiagnoseNounInfoServiceImpl
 * @功能：
 * @author：wlei
 * @日期：2022/8/1-03:29
 **/
@Service
public class TkmEndoscopeDiagnoseNounInfoServiceImpl implements
                                                     TkmEndoscopeDiagnoseNounInfoService {

    @Autowired
    private TkmEndoscopeDiagnoseNounInfoMapper diagnoseNounInfoMapper;

    @Override
    public List<LinkedHashMap<String, Object>> queryAllEndoscopeDiagnoseNouns() {
        return diagnoseNounInfoMapper.queryEndoscopeDiagnoseNounTree();
    }

    @Override
    public List<TkmEndoscopeDiagnoseNounInfo> selectByNounName(String name) {
        if (StringUtils.isEmpty(name)) {
            return new ArrayList<>();
        } else {
            return diagnoseNounInfoMapper.selectByName(name);
        }
    }

    @Override
    public List<TkmEndoscopeDiagnoseNounInfo> selectByNounNames(List<String> names) {
        return diagnoseNounInfoMapper.selectByNameIn(names);
    }

    @Override
    public List<TkmEndoscopeDiagnoseNounInfo> selectByNounIds(List<String> ids) {
        return diagnoseNounInfoMapper.selectByIdIn(ids);
    }

    @Override
    public TkmEndoscopeDiagnoseNounInfo selectByPrimaryKey(String id) {
        return diagnoseNounInfoMapper.selectByPrimaryKey(id);
    }
}
